In a case of developing computer software, a developer usually uses a high-level language such as a C language as a programming language. Source code written by the high-level language may be converted into an object code by using a compiler. The object code may be executed by a processor. In addition, an object file that includes the object code and another object file or a library which are referred to from the object code are linked by a linker, and then, an executable file may be generated.
By executing some processes written in the program in parallel, it is possible to accelerate processing. For example, there is a proposal in which a conditional expression within the loop determined to be executable in parallel is recognized based on a dependency between a control structure of a loop of an execution statement and data, a condition for satisfying the conditional expression is obtained before a task for parallel execution is generated, and then, the loop is modified to a loop that executes the task under the execution condition in parallel. In addition, there is also a proposal in which the number of processors is assigned to each parallel processing based on an amount of processing data per unit time of each parallel processing and an amount of input data per unit time such that an execution end time of each processing becomes equal.
Furthermore, there is also a proposal in which a scheduling code that controls execution order or a start time of the task is inserted into the object code in order to realize the high-speed execution of the entirety of tasks.
Japanese Laid-open Patent Publication No. 6-250988, Japanese Laid-open Patent Publication No. 6-187309, and International Publication Pamphlet No. WO 2008/072334 are examples of the related art.
In a case of executing a plurality of tasks in parallel, it is conceivable to grasp the number of clock cycles (or simply referred to as the number of cycles) desired for the execution of each task. For example, an assignment of a processing capability (for example, the number of threads) may be performed on each task according to the number of cycles. However, in some cases, a definition of the task or a definition of a function called from the task is written in another source file. In this case, since the compiling is performed for each source file, it is difficult for the compiler to determine the number of cycles of each task including the number of cycles of the function.
According to an aspect of the embodiments, the embodiments discussed herein aim to provide a computer that appropriately acquires the number of cycles of each task, a compiler program, and a link program and a compiling method.